Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a custom way to handle SSL exceptions #849

Open
wants to merge 1 commit into
base: series/0.23
Choose a base branch
from

Conversation

arturaz
Copy link

@arturaz arturaz commented Jan 15, 2024

Same thing that was provided for ember (http4s/http4s#7093).

Same thing that was provided for ember (http4s/http4s#7093).
Copy link
Member

@danicheg danicheg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good addition to Blaze, but I suggest we consult Ross before making any decisions.

Comment on lines +67 to +69
/** @param maxWrite
* \@see [[SSLStageDefaults.MaxWrite]].
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like missing scaladoc

final class SSLStage(
engine: SSLEngine,
maxWrite: Int,
sslHandshakeExceptionHandler: PartialFunction[Throwable, Unit]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's expected to handle SSLExceptions only, shouldn't the contract be PF[SSLException, Unit]?

*/
def withSslContext(
sslContext: SSLContext,
sslErrorHandler: PartialFunction[Throwable, Unit] = PartialFunction.empty,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be more beneficial to have a general error handler exposed to users and not only for SSL exceptions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth, Ember's general error handler just came up in http4s/http4s#7399. This is more in the direction that Ember is going, but probably away from the direction I'd prefer to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants